package com.elab.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = {"index", "/"})
public class indexController {
	
//	@ResponseBody
	@RequestMapping(value = {"/", "login"})
	String home (Model model, @RequestParam(value = "error", required = false) String error) {
		if (error != null) {
            model.addAttribute("error", "用户名或密码错误");
        }
		return "index";
	}
	
	@RequestMapping(value = {"/index"})
	String index () {
		return "index";
	}
}
